package behavioralPattern.mediator.example02;

public class Client {
    public static void main(String[] args) {
        // 中介者
        Mediator mediator = new ConcreteMediator();

        // 房东
        Person houseOwner = new HouseOwner("房东", mediator);
        // 房客
        Person tenant = new Tenant("房客",mediator);

        // 中介收集房东和房客的信息
        mediator.setHouseOwner(houseOwner);
        mediator.setTenant(tenant);

        // 中介者帮忙交互
        tenant.contact("123");
        houseOwner.contact("987");
    }
}
